package org.example.Utils;

import org.example.TankGan.pojo.Bullet.Bullet;

import java.util.Vector;

/**
 * @author cc
 * @date 2021/4/21 18:08
 * @Description 子弹射击类
 */

public class ShootBulletUtlis {
    private static Bullet bullet = null;
    private static Vector<Bullet> bullets= null;
    public static Vector<Bullet>  Shut(int x,int y,int direction,int speed,int Nums){
        bullets = new Vector<>(Nums);
        switch (direction){
            case 0: //上
                bullet = new Bullet(x + 20, y , 0, speed);
                break;
            case 1://右
                bullet = new Bullet(x+60,y+20,1,speed);
                break;
            case 2://下
                bullet = new Bullet(x+20,y+60,2,speed);
                break;
            case 3://左
                bullet = new Bullet(x,y+20,3,speed);
                break;
        }

        bullets.add(bullet);
        return bullets;
    }
}
